package com.ewzj.bigdata.mvp.model

import com.ewzj.bigdata.app.config.netmodel.CommonCache
import com.ewzj.bigdata.app.config.netmodel.CommonService
import com.ewzj.bigdata.app.extensions.json2Body
import com.ewzj.bigdata.mvp.contract.CitySelectorActivityContract
import com.ewzj.bigdata.mvp.contract.DecorateContract
import com.ewzj.bigdata.mvp.contract.VideoWebviewActivityContract
import com.ewzj.bigdata.mvp.model.bean.JsReqcommentBean
import com.ewzj.bigdata.mvp.model.reqbean.*
import com.ewzj.bigdata.mvp.model.rspbean.BaseData
import com.ewzj.bigdata.mvp.model.rspbean.CityBean
import com.ewzj.bigdata.mvp.model.rspbean.CitySearchBean
import com.ewzj.bigdata.mvp.model.rspbean.CommentBean
import com.google.gson.Gson
import com.jess.arms.integration.IRepositoryManager
import com.jess.arms.mvp.BaseModel
import io.reactivex.Observable
import io.rx_cache2.DynamicKey
import io.rx_cache2.EvictDynamicKey
import javax.inject.Inject

/**
 * author:zhangjing
 * 作用:
 * return:
 */
class VideoWebActivityModel @Inject constructor(val mGson:Gson, repositoryManager: IRepositoryManager) :BaseModel(repositoryManager),VideoWebviewActivityContract.Model{
    val service=repositoryManager.obtainRetrofitService(CommonService::class.java)
    val cache=repositoryManager.obtainCacheService(CommonCache::class.java)

    override fun doPraise(reqPraise: ReqPraise) :Observable<BaseData<String>>{
       return service.doPraise(json2Body(mGson.toJson(reqPraise)))
    }

    override fun doComment(reqcommentBean: Reqcomentbean) : Observable<BaseData<CommentBean>>{
       return service.doComment(json2Body(mGson.toJson(reqcommentBean)))
    }

    override fun doCollect(reqNormalCollect: ReqNormalCollect): Observable<BaseData<Any>> {
        return service.doCollect(json2Body(mGson.toJson(reqNormalCollect)))
    }
}